# -*- coding: utf-8 -*-
"""
date: Mon Dec 17 09:23:56 2018
python: Anaconda 3.6.5
author: kanade
email: kanade@blisst.cn
"""
import numpy as np
import matplotlib.pyplot as mp


x = np.linspace(-10, 10, 1000)
y1 = 8 * np.sinc(x)  # 非归一化sinc函数(辛格函数)
y2 = 8 * np.sinc(np.pi * x)  # 归一化sinc函数(辛格函数)

mp.figure('Grid', facecolor='lightgray')
mp.title('Grid', fontsize=20)
mp.tick_params(labelsize=10)

ax = mp.gca()
ax.xaxis.set_minor_locator(mp.MultipleLocator(0.5))
ax.yaxis.set_minor_locator(mp.MultipleLocator(0.4))

ax.grid(which='major', axis='both',
        linewidth=0.75, linestyle='-',
        color='cyan')
ax.grid(which='minor', axis='both',
        linewidth=0.5, linestyle='--',
        color='tomato')

mp.plot(x, y1, c='peru',
        label=r'$y=8sinc(x)$')
mp.plot(x, y2, c='y',
        label=r'$y=8sinc(\pi x)$')

mp.legend()
mp.show()
